package responsechain.handeler.impl;

import responsechain.handeler.Interview;
import responsechain.handeler.Handler;

public class OfficalPart extends Handler {
    @Override
    public boolean handle(Interview interview) {
        String name = interview.getName();
        log.i(name+":正在 "+getPartName()+" 进行招聘");
        if (interview.getSex() == 1) {
            log.w(name +": 性别不满足");
            return next(interview);
        }
        if (!interview.isHealth()) {
            log.w(name +": 健康状况不满足");
            return next(interview);
        }
        return offer(interview) || next(interview);
    }

    @Override
    protected String getPartName() {
        return "办公室";
    }

    @Override
    public int getHc() {
        return 1;
    }
}
